fix(gate-46): a fragment copied from a real GitHub link did not match the alias it was copied from - #206
Merged
Merged
Conversation
… the alias it was copied from
`heading_aliases` already emits both spellings of a heading — the kebab one
and the one GitHub actually publishes. The FRAGMENT, though, was pushed
through `slugify()` before comparison, and that rewrites `_` to `-`:
heading ### Requirement: Trace-scoped call correlation via
call_log.sessionId (REQ-011)
gh alias …-via-call_logsessionid-req-011 ← what GitHub links to
fragment …-via-call_logsessionid-req-011 ← what the author wrote
slugified …-via-call-logsessionid-req-011 ← what was compared
which matches neither: not the gh alias (its underscore had been rewritten)
and not the kebab alias (`call-log-sessionid`, split at the underscore). So a
tag whose link works was reported "anchor not found". Observed on
openconnector SynchronizationService.
Compares the raw fragment alongside the slugified forms.
Four assertions, two of them controls: a near-miss fragment (`call_logrequestid`
against a `call_logsessionid` heading) and an underscore fragment against a
file that has no such heading both still fail. Accepting the raw spelling must
not become accepting any fragment that shares a prefix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
heading_aliasesalready emits both spellings of a heading — the kebab one and the one GitHub actually publishes. The fragment, though, was pushed throughslugify()before comparison, and that rewrites_to-:### Requirement: Trace-scoped call correlation via call_log.sessionId (REQ-011)…-via-call_logsessionid-req-011← what GitHub links to…-via-call_logsessionid-req-011← what the author wrote…-via-call-logsessionid-req-011← what was comparedThat matches neither alias: not the gh one (its underscore had been rewritten), and not the kebab one (
call-log-sessionid, split at the underscore). So a tag whose link works fine on GitHub was reported@spec anchor not found.Observed on openconnector
SynchronizationService, while clearing gate-46 debt.The fix compares the raw fragment alongside the slugified forms.
Tests
Four assertions, two of them controls: a near-miss fragment (
call_logrequestidagainst acall_logsessionidheading) and an underscore fragment against a file with no such heading both still fail. Accepting the raw spelling must not become accepting any fragment that shares a prefix.Suite: 37 passed. Full helper-suite run: 27 passed, 2 quarantined as documented, 0 failed.